<!DOCTYPE html>
<html lang="en">

<head>
    <title>未关闭事项管理</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=86e2297f">
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=222aea35">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_855021_i2jfy4r0uq.css">
</head>
<style type="text/css">
.s-l1{
    height: 30px;
    border-bottom: 1px solid #666;
}
.s-l1 span input{
    height: 24px;
    width: 80px;
    text-align: center;
    margin-right: 5px;
    border: 1px solid #ddd;
    padding: 0;
    outline: none;
    border-radius: 0;
}
.s-l1 span  .oaBtn{
    border:none;
}

.s-l2 {
    height: 25px;
}

.s-l2 .selected{
    color: #228bee;
}

.s-l2 input{
    border: 0;
    background-color: #fff;
    padding: 0;
    margin-right: 5px;
    outline: none;
}
.s-l3 span{
    float: left;
    display: inline-block;
    height: 25px;
    line-height: 25px;
    margin-right: 10px;
}

span.lineOne{
    line-height: 27px !important;
    height: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}
    .tip-box {
        background-color: #d3e8fd;
        position: absolute;
        width: 99%;
        left: 0;
        padding: 5px;
        z-index: 1;
        display: none;
    }
    .tip-box .up-arrow {
        display: inline-block;
        position: absolute;
        top: -5px;
        left: 40px;
        border-width: 0 6px 5px;
        border-style: solid;
        border-color: transparent transparent #d3e8fd;
    }
    .fj-tanzhongStyle{
        width: 145px;
    }
    .fj-tanzhongStyle .name{
        width: 70%;
        height: 14px;
        line-height: 13px;
    }
    .mybox-leave-active,.mybox-enter-active{
        transition:all 0.5s ease;
    }
    .mybox-leave-active,.mybox-enter{
        height:0px !important;
    }
    .mybox-leave,.mybox-enter-active{
        height: 150px;
    }
    a { cursor: pointer}
    p { margin: 0;}

    .table-s {margin-bottom: 0}

    .table-s th {
        text-align: center;
    }
    .table-s td {
        border-top: 0 !important;
        height: 24px;
    }

    .table-s .list:hover,
    .table-s .list-track:hover {
        background-color: #fff !important;
    }

    .table-s .list td {
        background-color: #ccc  !important;
        padding: 5px;
        /* border-bottom: 1px solid #ffffff; */
    }

    .table-s .list .main-info{
        width: 60%;
        vertical-align: top;
        border-left: 1px solid #ddd;
        position: relative;
    }
    .table-s .list .main-info .title{
        font-weight: bold;
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-s .list .minor-info{
        color: #999;
        width: 400px;
    }
    .table-s .list .minor-info p{
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 395px;
    }
    .table-s .list .operating{
        width: 50px;
        text-align: center;
        border-right: 1px solid #ddd
    }
    .table-s .list .operating p{
        cursor: pointer;
        color: #69b0f3;
        line-height: 25px;
    }

    .table-s .list .info-w{
        display: inline-block;
        width: 210px
    }
    .table-s .list .minor-info .wl{
        letter-spacing:6px;
    }
    .table-s .list .minor-info .wl1{
        letter-spacing:18px;
    }

    .table-s .list-track td{
        padding: 5px
    }

    .table-s .list-track .user{
        text-decoration: underline;
        color: #999;
        float: left
    }
    .table-s .list-track .track-info{
        padding-left: 5px;
        width: 83%;
        float: left;
    }

    .icon-zhankai,.icon-shouqi{
        cursor: pointer;
        color: #69b0f3;
        font-size: 18px;
        border: 1px solid;
        border-radius: 5px;
    }

    .attcach-list .icon-zhankai,.attcach-list .icon-shouqi{
        font-size: 18px;
        line-height: 12px;
        border: 0;
    }
    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }
    .table>thead>tr>th{
        background:#d3e8fd !important;
    }

    .ui_dialog,.ui_inner,table.ui_border{
        border: 0 !important;
    }

    .lefts {
        text-align: center;
        color: #fff;
        /* background-image: url(/dist/img/tabApp.png); */
        /*margin-left: 8px;*/
        /*margin-right: 8px;*/
        /* background-size: 100% 100%; */
        padding: 4px 15px 3px 15px;
        /*border: 1px solid #2a8cec;*/
        border-bottom: none;
        background: #228bee;
        z-index: 999;
        border-top-left-radius: 3px;
        border-top-right-radius: 3px;
    }
    .rights {
        text-align: center;
        color: #000;
        font-size: 14px;
        margin-left: 10px;
        margin-right: 10px;
        margin-top: 3px;
        cursor: pointer;
    }
    .slide-box {
        display: -webkit-box;
        -webkit-overflow-scrolling: touch;
        height: 34px;
        line-height: 34px;
        /* background: #2a8cec; */
        width: 100%;
        padding-left: 5px;
        border-bottom: 1px solid #989898;
    }
    .slide-box1 {
        display: -webkit-box;
        /* overflow-x: scroll; */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        height: 30px;
    }
    .right {
        text-align: center;
        color: #666666;
        font-size: 12px;
        /* border-bottom: 2px solid #f8f8f8; */
        margin-left: 8px;
        margin-right: 8px;
        padding-top: 7px;
        padding-bottom: 5px;
        cursor: pointer;
    }
    .left {
        text-align: center;
        color: #228bee;
        /*border-bottom: 2px solid #228bee;*/
        margin-left: 8px;
        margin-right: 8px;
        padding-bottom: 5px;
    }
    .border-b{
        border-bottom: 1px solid red;
    }
    .content {
        padding: 8px 8px 0 8px;
    }
</style>
<body>
    <iframe id="ifAttach" style="display:none"></iframe>
    <section class="content" id="app" style="min-width:1172px" v-cloak>
        <div>
            <div style="overflow: hidden;top: 0;left: 0;width: 100%;">
                <div class="slide-box">
                    <div class="rights">
                        <span v-for="(item,i) in companyList" :class="item.selected? 'lefts':'rights'" 
                            style="height: 30px" @click="companyFilter(item,companyList)">
                            {{item.name?item.name:item.allName}}
                        </span>
                    </div>
                </div>
            </div>


            <!-- <div class="s-l1">
                <span>
                    <template v-for="(item,i) in companyList">
                        <input type="button" :value="item.name?item.name:item.allName" :class="item.selected?'btn oaBtn btn-sm':''" style="float:left" @click="companyFilter(item,companyList)"/>
                    </template>
                </span>
            </div> -->
            <!--获取部门-->
            <div style="position: relative;">
                <div class="slide-box1">
                    <div  class="right">
                        <span v-for="(item,i) in departList" :class="item.selected? 'left':'right'" style="height: 30px"
                        @click="departFilter(item,departList)">
                            {{item.name}}
                        </span>
                        <span :class="departSelectedAll? 'left':'right'" style="height: 30px"
                            v-if="departList.length>1" @click="departAll(departList)">
                            全部
                        </span>
                    </div>
                </div>
                <div style="position: absolute;right:0px;top:3px" >
                    <div class="has-feedback">
                        <select class="form-control pull-left input-sm" v-model="matterType" @change="selCompany" style="width: 120px;height: 25px;font-size: 12px;line-height: 25px;padding-top: 0px;padding-bottom: 0px;padding-left: 6px;margin-right: 5px">
                            <option value="" selected>事项类型</option>
                            <option value="1">发起事项</option>
                            <option value="2">负责事项</option>
                            <option value="3">参与事项</option>
                            <option value="4">抄送事项</option>
                        </select>
                        <input type="text" class="form-control input-sm"
                                placeholder="关键字"  v-model="keyWord" style="width:200px;float: left;height: 24px;">
                        <!-- <span id="btnQuery" class="glyphicon glyphicon-search form-control-feedback" @click="search()"></span> -->
                        <button type="button" class="btn oaBtn btn-sm pull-left" style="margin: 0 10px;" @click="search">搜索</button>
                        <input type="button" value="新增事项" class="btn oaBtn btn-sm pull-right" @click="showDialog('add',0)">
                    </div>
                </div>
            </div>

            <!-- <div style="height: 100px;">
                <div class="s-l1">
                    <span>
                        <template v-for="(item,i) in companyList">
                            <input type="button" :value="item.name?item.name:item.allName" :class="item.selected?'btn oaBtn btn-sm':''" style="float:left" @click="companyFilter(item,companyList)"/>
                        </template>
                        <input type="button" v-if="companyList.length>1" value="全部" :class="companySelectedAll?'btn oaBtn btn-sm':''" @click="companyAll(companyList)"/>
                    </span>
                    <input type="button" value="新增事项" class="btn oaBtn btn-sm pull-right" @click="showDialog('add',0)">
                </div>
                <div class="s-l2">
                    <template v-for="(item,i) in departList">
                        <input type="button" :class="item.selected?'selected':''" :value="item.name?item.name:item.allName" @click="departFilter(item,departList)"/>
                    </template>
                    <input type="button" v-if="departList.length>1" :class="departSelectedAll?'selected':''" value="全部" @click="departAll(departList)"/>
                </div>
                <div class="s-l3">
                    <span style="float:left">事项类型</span>
                    <select class="form-control pull-left input-sm" v-model="matterType" @change="selCompany" style="width: 120px;height: 25px;font-size: 12px;line-height: 25px;padding-top: 0px;padding-bottom: 0px;padding-left: 6px;margin-right: 5px">
                        <option value="" selected>全部事项</option>
                        <option value="1">发起事项</option>
                        <option value="2">负责事项</option>
                        <option value="3">参与事项</option>
                        <option value="4">抄送事项</option>
                    </select>
                    <input type="text" placeholder="关键字" id="txtParent" class="form-control pull-left input-sm" style="width: 200px;"
                        v-model="keyWord">
                    <button type="button" class="btn oaBtn btn-sm pull-left" style="margin-left: 10px;" @click="search">搜索</button>
                </div>
            </div> -->
            

            <div class="div-td-content-more"><i></i></div>
            <div class="box-body no-padding iframeH5"  style="overflow: auto;" id="scrollDiv">
                <div id="progress" class="wyui-progress"></div>
                <template v-if="list.length==0">
                    <div style="text-align: center;font-weight: bold;font-size:30px">暂无数据</div>
                </template>
                <div class="fixed-table-box head-fixed " style="overflow: hidden;" v-if="list.length>0">
                    <div class="fixed-table_header-wraper" >
                        <table class="table table-hover table-s">
                            <thead>
                                <tr>
                                    <th style="width:30px;border-left: 0">序号</th>
                                    <th style="width:255px">事项名称</th>
                                    <th style="width:80px">预计开始日期</th>
                                    <th style="width:80px">预计结束日期</th>
                                    <th style="width:55px">发布人</th>
                                    <th style="width:55px">负责人</th>
                                    <th >参与人</th>
                                    <th >抄送人</th>
                                    <th style="width:90px;" >状态</th>
                                    <th style="width:40px;border-right: 0" class="zt">操作</th>
                                    <th style="width:17px;border-left: 0" v-if="showZW"></th>
                                </tr>
                            </thead>
                        </table>
                    </div>

                    <div class="fixed-table_body-wraper iframeFixed" v-if="list.length>0">
                        <table cellspacing="0" cellpadding="0" border="0" class="fixed-table_body table-hover" style="width: 100%;">
                            <tbody id="tbList">
                                <tr v-for="item,i in list" >
                                    <td style="width:30px;text-align: center">{{item.sn}}</td>
                                    <td style="width:255px"><span class="lineOne">{{item.TRACK_TITLE}}</span></td>
                                    <td style="width:80px;text-align: center">{{item.START_TIME}}</td>
                                    <td style="width:80px;text-align: center">{{item.PREDICT_TIME}}</td>
                                    <td style="width:55px;text-align: center">{{item.USER_NAME}}</td>
                                    <td style="width:55px;text-align: center">{{item.PRINCIPAL_NAME}}</td>
                                    <td><span class="lineOne">{{item.cyrName}}</span></td>
                                    <td><span class="lineOne">{{item.csrName}}</span></td>
                                    <td style="width:90px;text-align: center;position: relative;">
                                        <div v-if="(item.JOB_STATE==0 && item.PRINCIPAL==currentUser.id) || (item.JOB_STATE==3 && item.PRINCIPAL==currentUser.id)" class="flashing" style="border:1px solid #228bee;width:100%;height: 100%;box-shadow:0px 0px 4px #228bee inset;position:absolute;top:0;left:0;"></div>
                                        <span v-if="item.JOB_STATE==0" :class="item.statusIsToday?'border-b':''" :style="item.PRINCIPAL==currentUser.id?'color: red':''">待处理</span>
                                        <span v-if="item.JOB_STATE==1" :class="item.statusIsToday?'border-b':''">已关闭</span>
                                        <span v-if="item.JOB_STATE==2" :class="item.statusIsToday?'border-b':''">处理中</span>
                                        <span v-if="item.JOB_STATE==3" :class="item.statusIsToday?'border-b':''" :style="item.PRINCIPAL==currentUser.id?'color: red':''">已完成-待审核</span>
                                        <span v-if="item.JOB_STATE==4" :class="item.statusIsToday?'border-b':''">已撤销</span>
                                        <span v-if="item.JOB_STATE==5" :class="item.statusIsToday?'border-b':''">后续-处理中</span>
                                    </td>
                                    <td @click="openDesc(item)" style="width:40px;text-align: center;color: #228bee;cursor: pointer;">
                                    <span v-if="(currentUser.id==item.USER_ID || item.PRINCIPAL == currentUser.id || item.isCyr) && item.JOB_STATE!=1 && item.JOB_STATE!=4">编辑</span>
                                    <span v-else>查看</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class="oa-pager text-center" style="margin-top: 5px;">
            共<span id="allCount">{{recordCount}}</span>条记录&nbsp;&nbsp;&nbsp;
            <span id="nowPage">{{pageIndex}}</span>/<span id="allPage">{{pageCount}}</span>&nbsp;&nbsp;&nbsp;
            <span id="first" class="oa-pager-button" @click="pagination('first')">首页</span>
            <span id="prev" class="oa-pager-button" @click="pagination('pre')">上一页</span>
            <span id="next" class="oa-pager-button" @click="pagination('next')">下一页</span>
            <span id="last" class="oa-pager-button" @click="pagination('last')">尾页</span>
        </div>

    </section>
    <script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
    <!--插件JS-->
    <script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
    <script src="/dist/plugins/fixedTable/fixed-table.js"></script>
    <!--框架已定义 JS-->
    <script src="/dist/js/app_iframe.js?t=8e743a31"></script>
    <!--oa自定义  JS-->
    <script src="/dist/js/oa.js?t=54c6b89c"></script>
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
    <script type="text/javascript" src="/dist/plugins/select2/select2.full.min.js"></script>

    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                currentUser: getCurrentUser(),
                pageIndex: 1,
                pageCount: 1,
                recordCount: 1,
                list: [],
                keyWord: "",
                matterType:"",
                selectedCompanyId:"",
                selectedDepartId:"",
                isEmptyData:false,
                showZW:true,
                companyList: [],
                departList: [],
                companySelectedAll:false,
                departSelectedAll:false,
                selectDepart: 0,
                selectCompany: 0
            },
            methods: {
                refresh: function () {
                    var that = this;
                    //事项管理
                    top.getRedHot();
                    $.wyui.postMethod(urlConfig.wreport.wreportUnfinish.getWReportUnfinishMainList, {
                        requestPage: that.pageIndex,
                        keyWord: that.keyWord,
                        userId: that.currentUser.id,
                        selectedCompanyId: that.selectedCompanyId,
                        selectedDepartId: that.selectedDepartId,
                        matterType: that.matterType,
                        isNewUnfinish:4
                    }, function (data) {
                        for (var i = 0; i < data.records.length; i++) {
                            data.records[i].btnOp = 0;
                            data.records[i].contentList = data.records[i].TRACK_CONTENT.split("\n");
                            data.records[i].attachesOpen = 0;
                            if(data.records[i].cyr!=undefined && data.records[i].cyr.indexOf(that.currentUser.id)>-1)
                                data.records[i].isCyr = true;
                            else
                                data.records[i].isCyr = false;
                        }
                        that.list = data.records;
                        if(that.list.length == 0)
                            that.isEmptyData = true;
                        else
                            that.isEmptyData = false;
                        that.pageCount = data.pager.pageCount;
                        $("#nowPage").html(data.pager.pageIndex);
                        $("#allPage").html(data.pager.pageCount);
                        $("#allCount").html(data.pager.recordCount);

                        setTimeout(() => {
                            var sH = $("#scrollDiv").height();
                            var headHS = $(".head-fixed").height();
                            var ths = $(".fixed-table_header-wraper th");
                            if(headHS<(sH-20)){
                                that.showZW = false;
                                $(".fixed-table_header-wraper .zt").css("border-right","");
                            }else{
                                that.showZW = true;
                                $(".fixed-table_header-wraper .zt").css("border-right","0px");
                            }

                            var windowHeight = $(window).height();
                            $("#scrollDiv").css("height",windowHeight - 120 );
                        }, 100);
                        
                    });
                },
                getDepartListByCompanyId:function(companyId){
                    var that=this;
                    $.wyui.postMethod(urlConfig.system.depart.getByCompanyId, {
                        companyId: companyId
                    }, function (data) {
                        for(var i=0;i<data.length;i++){
                            if(i==0){
                                data[i].selected = true;    
                            }else{
                                data[i].selected = false;
                            }
                        }
                       
                        that.departList = data;
                    });
                },
                companyFilter:function(item,companyList){
                    var that =this;
                    for (var i = 0; i < companyList.length; i++) {
                        companyList[i].selected = false;
                    }
                    item.selected = true;
                    this.selectedCompanyId=item.id;
                    var flag =true;
                    for (var i = 0; i < companyList.length; i++) {
                        if(companyList[i].selected){
                            that.companySelectedAll = false;
                            flag =false;
                            break;
                        }
                    }
                    this.getDepartListByCompanyId(this.selectedCompanyId);
                    // if(flag)
                        // this.companySelectedAll = true;
                    this.refresh();
                },
                companyAll:function(companyList){
                    for (var i = 0; i < companyList.length; i++) {
                        companyList[i].selected = false;
                    }
                    this.companySelectedAll = true;
                    this.departSelectedAll = true;
                    this.selectedCompanyId="";
                    this.selectedDepartId = "";
                    this.departList=[];
                    this.refresh();
                },
                departFilter:function(item,departList){
                    for (var i = 0; i < departList.length; i++) {
                        departList[i].selected = false;
                    }
                    item.selected = true;
                    this.selectedDepartId = item.id;
                    var flag =true;
                    for (var i = 0; i < departList.length; i++) {
                        if(departList[i].selected){
                            this.departSelectedAll = false;
                            flag =false;
                            break;
                        }
                    }
                    if(flag)
                        this.departSelectedAll = true;
                    this.refresh();
                },
                departAll:function(departList){
                    for (var i = 0; i < departList.length; i++) {
                        departList[i].selected = false;
                    }
                    this.departSelectedAll = true;
                    this.selectedDepartId = "";
                    this.refresh();
                },
                search: function () {
                    this.pageIndex = 1;
                    this.refresh();
                },
                pagination: function (auction) {
                    if (auction == "first")
                        this.pageIndex = 1;
                    else if (auction == "next" && this.pageIndex < this.pageCount)
                        this.pageIndex += 1;
                    else if (auction == "pre" && this.pageIndex > 1)
                        this.pageIndex -= 1;
                    else if (auction == "last")
                        this.pageIndex = this.pageCount;
                    this.refresh();
                },
                closeMatter:function(item){
                    if(confirm("确定关闭该事项？")){
                        $.wyui.postMethod(urlConfig.wreport.wreportUnfinish.closeMatter, {
                            id: item.ID
                        }, function (data) {
                            this.refresh();
                        });
                    }
                },
                openDesc:function(item){
                    top.closeTabByPageId("detail-dec");
                    top.addTabs({
                        id: 'detail-dec',
                        title: '事项详情',
                        close: true,
                        url: 'wreport/matterTrackManagement/detail-desc.html?pageType=edit&id='+item.ID
                    });
                },
                addTrack:function(item){
                    var sTitle = trimRN2(item.TRACK_TITLE)==''?'添加跟踪':'添加跟踪（' + item.TRACK_TITLE.substring(0,25)+ '）';
                    var userName = this.currentUser.name;
                    $.dialog({
                        content: 'url:addTrack.html?mainId=' + item.ID+'&userName=' + userName + '&principal=' + item.PRINCIPAL + '&publisher=' + item.USER_ID + '&trackTitle=' + item.TRACK_TITLE.substring(0,25),
                        title: sTitle,
                        width: 700,
                        height: 250,
                        max: false,
                        min: false,
                        lock: true
                    }).max();
                },
                addReply:function(item){
                    $.dialog({
                        content: 'url:addReply.html?trackId=' + item.ID,
                        title: '回复跟踪（'+item.USER_NAME + new Date(item.CREATE_TIME).Format("MM-dd hh:ss")+'）',
                        width: 700,
                        height: 250,
                        max: false,
                        min: false,
                        lock: true
                    });
                },
                showDialog: function (pageType, item) {
                    var condition ="";
                    if(pageType == "edit"){ 
                        condition += "&id="+item.ID;
                        condition += "&userId="+item.USER_ID;
                        condition += "&principal=" + item.PRINCIPAL;
                        condition += "&principalName=" + item.PRINCIPAL_NAME;
                        condition += "&csrPerson=" + (item.csr == undefined?"":item.csr);
                        condition += "&cyrPerson=" + (item.cyr == undefined?"":item.cyr);
                        condition += "&csrPersonName=" + (item.csrName == undefined?"":item.csrName);
                        condition += "&cyrPersonName=" + (item.cyrName == undefined?"":item.cyrName);
                        condition += "&trackTitle=" + item.TRACK_TITLE;
                        condition += "&trackContent=" + item.TRACK_CONTENT;
                        condition += "&predictTime=" + (item.PREDICT_TIME==""?"":new Date(item.PREDICT_TIME).Format("yyyy-MM-dd")); 
                    }
                    $.dialog({
                        content: 'url:detail.html?pageType=' + pageType + (condition == "" ? "" : condition),
                        title: "<div style='font-size:20px'>新增事项</div>",
                        width: 700,
                        height: 340,
                        max: false,
                        min: false,
                        lock: true
                    });
                },
                selCompany:function(val){
                    this.refresh();
                },
                moreTrack: function (i, item) {
                    var that = this;
                    item.btnOp = 1;
                },
                closeTrack: function (i, item) {
                    item.btnOp = 0;
                },
                toggleAttcach:function(item){
                    if(item.attachesOpen == 1)
                        item.attachesOpen = 0;
                    else
                        item.attachesOpen = 1;
                },
                moreReply: function (item) {
                    item.btnReply = 1;
                    if (item.replayList.length == 0) {
                        item.replayList = [];
                        $.wyui.postMethod(urlConfig.wreport.wreportUnfinish.getWReportUnfinishReply, {
                            trackId: item.ID
                        }, function (data) {
                            for (var i = 0; i < data.length; i++) {
                                var reply = new Object();
                                reply.REPLY_CONTENT = data[i].REPLY_CONTENT;
                                reply.USER_NAME = data[i].USER_NAME;
                                reply.CREATE_TIME = data[i].CREATE_TIME;
                                item.replayList.push(reply);
                            }
                        });
                    }
                },
                closeReply: function (item) {
                    item.btnReply = 0;
                },
                download: function (attachId, fileName) {
                    downloadFile(attachId,fileName)
                    return false;
                },
                fjStyle: function (fjName) {
                    if (fjName) {
                        var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                        return 'img fj-' + type
                    }
                    return 'img'
                },
                initSearch:function(){
                    var that = this;

                    $.wyui.postMethod(urlConfig.system.company.getCompanyByUserId, {userId: getCurrentUser().id}, function (data) {
                        for (var i = 0; i < data.length; i++) {
                            if(i==0){
                                data[i].selected = true;
                                that.selectedCompanyId = data[i].id;
                            }else
                                data[i].selected = false;
                        }
                        that.companyList = data;
                    },true);

                    $.wyui.postMethod(urlConfig.system.depart.getByCompanyId, {
                        companyId: that.selectedCompanyId
                    }, function (data) {
                        for(var i=0;i<data.length;i++){
                            if(currentUser.departId == data[i].id){
                                data[i].selected = true;
                                that.selectedDepartId = data[i].id;
                            }else{
                                data[i].selected = false;
                            }
                        }
                        that.departList = data;
                    },true);
                }
            },
            mounted: function () {
                var that = this;
                this.initSearch();
                this.refresh();
            }
        });
        function refresh(toStart) {
            if(toStart)
                app.pageIndex=1;
            app.refresh();
        }

        $.wyui.page.dataUrl = server.ip + urlConfig.wreport.wreportUnfinish.getWReportUnfinishMainList;
        $.wyui.page.queryParams.userId = $.wyui.page.urlParams.userId ? $.wyui.page.urlParams.userId : getCurrentUser().id;
        $.wyui.page.getByPage_callback = function (records) {
            console.log(records)
            app.list.main = records;
            document.getElementById("scrollDiv").scrollTop = 0;
        };
        $.wyui.page.getByPage_scroll_callback = function (list) {
            if (list.length < 30) {
                isLoad = false;
            } else {
                for (var i = 0; i < list.length; i++) {
                    app.list.push(list[i]);
                }
                isLoad = true;
            }
        };

    </script>
    <script type="text/javascript">
    $(function(){
        setInterval(() => {
            $(".flashing").fadeOut(500).fadeIn(200); 
        }, 1000);
        $(document).on("click",".lineOne",function(){
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 6 + "px",
                        "left": $(this).offset().left - 3,
                        "top": ($(this).offset().top + $(this).outerHeight()) +3 + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });

        $("#app").on("click",".title",function(){
            $(this).next().toggle();
        });

        $(window).resize(function(){
            setTimeout(() => {
                var windowHeight = $(window).height();
                $("#scrollDiv").css("height",windowHeight - 120);
            }, 200);
        });
    });
    
    //初始化FixedTable
    $(".fixed-table-box").fixedTable();
    </script>
</body>

</html>